package cn.openread.demo.multithread.sync;

/**
 *  public static void main(java.lang.String[]);
 *     descriptor: ([Ljava/lang/String;)V
 *     flags: ACC_PUBLIC, ACC_STATIC
 *     Code:
 *       stack=2, locals=3, args_size=1
 *          0: ldc           #2                  // class com/jiagouedu/sync/Synchronized01
 *          2: dup
 *          3: astore_1
 *          4: monitorenter
 *          5: aload_1
 *          6: monitorexit
 *          7: goto          15
 *         10: astore_2
 *         11: aload_1
 *         12: monitorexit
 *         13: aload_2
 *         14: athrow
 *         15: invokestatic  #3                  // Method m:()V
 *         18: return
 *
 * */
//javap -v Synchronized01.class
public class Synchronized01 {
    public static void main(String[] args) {
// 对Synchronized Class对象进行加锁
        synchronized (Synchronized01.class) {
        }
// 静态同步方法，对Synchronized Class对象进行加锁
        m();
    }

    public static synchronized void m() {
    }
}
